using System;
using System.Collections.Generic;
using System.Text;
using SlimDX;
using SlimDX.Direct3D9;
using System.Runtime.InteropServices;

namespace Barrage.Global.Vertex
{
    /// <summary>
    /// Vertex with position and texture coordinate information
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct VertexPositionUV
    {
        /// <summary>
        /// Position Vector
        /// </summary>
        public Vector3 Position;
        /// <summary>
        /// Texture Coordinates Vector
        /// </summary>
        public Vector2 UV;

        /// <summary>
        /// Size in bytes of the structure
        /// </summary>
        public static int SizeBytes
        {
            get { return Marshal.SizeOf(typeof(VertexPositionUV)); }
        }

        /// <summary>
        /// Vertex Format: Position and UV Set
        /// </summary>
        public static VertexFormat Format
        {
            get { return VertexFormat.Position | VertexFormat.Texture1; }
        }

        /// <summary>
        /// Creates the structure
        /// </summary>
        /// <param name="position">Position Vector</param>
        /// <param name="UV">Texture Coordinates Vector</param>
        public VertexPositionUV(Vector3 position, Vector2 UV)
        {
            this.Position = position;
            this.UV = UV;
        }
    }
}